<template>
  <div>
    <el-input
      type="textarea"
      :rows="6"
      placeholder="卖家备注"
      v-model="remark">
    </el-input>
    <div slot="footer" class="dialog-footer">
      <el-button size="small" type="primary" @click="submit">提 交</el-button>
      <el-button size="small" @click="close">取 消</el-button>
    </div>
  </div>
</template>

<script>
  import api from "@/api/order.service.js";

  export default {
    name: 'receiverInfo',
    data() {
      return {
        remark: ''
      }
    },
    props: {
      orderDetail: {
        type: Object,
        default: () => {
          return {}
        }
      }
    },
    methods: {
      close(flag) {
        this.$emit('close',flag)
      },
      submit() {
        api.updateOrderItemRemark({id: this.orderDetail.id, remark: this.remark}).then(res => {
          console.log(res);
          if (res.code == 200) {
            this.$message({
              message: this.$t('common.operateSucccess'),
              type: 'success'
            })
            this.close(true)
          }
        })
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .dialog-footer {
    margin-top:30px;
    text-align: center;
  }
</style>
